package com.education.wisdom.service;


import com.education.wisdom.pojo.Catalog;

import java.util.List;
import java.util.Map;

/**
 * 目录体系 服务层
 *
 * @author ruoyi
 * @date 2018-11-15
 */
public interface ICatalogService {

    Catalog selectByCatalogId2(Integer catalogId);

    //查询是否购买课程
    List<Catalog> isBuy(Integer userId, List<Integer> catalogId, String name,Integer schoolId);

    List<Catalog> isNotBuy(Integer userId, List<Integer> catalogId, String name,Integer schoolId);

    public List<Catalog> selectCatalogBySchoolId(Integer schoolId);

    Catalog selectCatalogInfoById(Integer parentId);

    List<Catalog> selectByCatalogId(Integer catalogId);

    public List<Catalog> selectCatalogList2(Catalog catalog);

    /**
     * 试卷展示页面左侧课程展示
     *
     * @param map
     * @return
     */
    Catalog leftClassInfo(Map<String, Object> map);

    List<Catalog> selectCatalogById(Map<String, Object> map);

    /**
     * 精品课程展示
     */
    List<Catalog> bestClass(Map<String, Object> map);

    /**
     * 查询我的收藏
     *
     * @param userId 用户编号
     * @return
     */
    List<Catalog> selectMyCollection(String userId);

    /**
     * 热门课程
     */
    List<Catalog> hotClass(Map<String, Object> map);

    /**
     * 右侧热门课程展示
     */
    public List<Catalog> rightHot();

    public List<Catalog> selectCatalogList(Catalog catalog);

    /**
     * 根据课程名称进行查询
     * @param catalog
     * @return
     */
    public List<Catalog> selectCatalogListByName(Catalog catalog);

    /**
     * 免费好课展示
     */
    public List<Catalog> freeClass();

    /**
     * 右侧免费课程展示
     */
    public List<Catalog> rightFree();

    public List<Catalog> newClass(Map<String, Object> map);

    public List<Catalog> CurriculumLists();

    public Catalog classInfo(Integer catalogId);

    public List<Catalog> more(Map<String, Object> map);

    public List<Catalog> hot(Map<String, Object> map);

    public List<Catalog> allList(Map<String, Object> map);

    public List<Catalog> newLists(Map<String, Object> map);

    public List<Catalog> hotLists(Map<String, Object> map);

    //查看我的收藏
    List<Catalog> selectListByUserId(String userId);

    //查看我的购买列表
    List<Catalog> selectBuyListByUserId(String userId);

    /**
     * 查询我的课程
     *
     * @param map
     * @return
     */
    public List<Catalog> selectByUser(Map<String, Object> map);

    /***
     * 点击量统计修改
     * @param catalog
     * @return
     */
    int updateCataLog(Catalog catalog);

    /***
     * 删除
     * @param catalogId
     * @return
     */
    int delectCataLogById(String catalogId);

    public List<Catalog> classLista(Map<String, Object> map);

    public List<Catalog> classListb(Map<String, Object> map);

    public List<Catalog> selectCatalogLists(String uId);

    public List<Catalog> selectBig();

    public List<Catalog> selectBig2();

    public List<Catalog> selectBySmall(Integer catalogId);

    public List<Catalog> selectBySmall2(Integer catalogId);

    public List<Catalog> selectCatalogByLeft(Map<String, Object> map);

    public List<Catalog> selectCategoriesList();

    /**
     * 通过ParentId查询数据
     *
     * @param ParentId
     * @return
     */
    List<Catalog> selectByParentId(Integer ParentId);
    Integer[]  selectByCatalogIdParentId(Integer ParentId);

    /**
     * 通过ParentId查询数据
     *
     * @param parentId
     * @return
     */
    List<Catalog> selectByParentId2(Integer parentId);

    /**
     * 通过ParentId 和 schoolId 查询数据
     *
     * @param parentId
     * @return
     */
    List<Catalog> selectByParentIdThree(Integer parentId,Integer schoolId);

    List<Catalog> selectByParentIdsAndSort(List<Integer> parentId, Integer sort);

    /**
     * @param ParentId
     * @param sort     排序字段
     * @return
     */
    List<Catalog> selectByParentIdAndSort(Integer ParentId, Integer sort);

    List<Catalog> selectByCatalogIdAndSort(Integer catalog, Integer sort);

    /**
     * 根据目录等级查询列表
     *
     * @param i 等级
     * @return
     */
    List<Catalog> selectcatalogBySort(Integer i);

    /**
     * 根据catalogId查询资源
     *
     * @param catalogId
     * @return
     */
    Catalog selectCatalogByCatalogId(Integer catalogId);

    /**
     * 根据课程id 查找所需字段
     * @param catalogId
     * @return
     */
    Catalog selectCatalogByCatalogIdToBuy(Integer catalogId);

    void insertCatalog(Catalog catalog);

    List<Catalog> selectByUserIdAndCatalogId(Map<String, Object> map);

    List<Catalog> selectList(Map<String, Object> map);

    List<Catalog> selectByLikeName(String name);

    List<Catalog> selectByThreeCatalogId();

    List<Catalog> selectTwoCatalogList();

    //根据目录等级查询
    List<Catalog> selectBySort(Integer sort);

    List<Map<String, Object>> selectCatalogTree();


    //删除目录
    int deleteByCatalogId2(Integer id);

    //根据一级目录查询所有课程
    List<Catalog> selectCatalogByOne(Integer catalogId,String name);

    List<Catalog> buyCatalog(Integer userId);

    /**
     *  查询学校线下购买课程信息
     */
    List<String> isBuyOffline(List<Integer> list);

    List<Catalog> selectLikeByUserId(Integer userId);

    Integer[] selectCatalogIds();

    /**
     * 查询全部二级目录Integer List
     *
     * @return
     */
    List<Integer> selectALLTwoLevelMenus();
}
